/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package View;

import javax.swing.JOptionPane;

/**
 *
 * @author Bernardo Costa
 */
public class MainPort extends javax.swing.JFrame {

    /**
     * Creates new form MainPort
     */
    public MainPort() {
        super("ThreeDs - Database Data Dictionary");
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        supPanel = new javax.swing.JPanel();
        MenuSuperior = new javax.swing.JMenuBar();
        Arquivo = new javax.swing.JMenu();
        Desconectar = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();
        Sair = new javax.swing.JMenuItem();
        Esquemas = new javax.swing.JMenu();
        meusEsquemas = new javax.swing.JMenuItem();
        cadEsquemas = new javax.swing.JMenuItem();
        altEsquemas = new javax.swing.JMenuItem();
        DicionarioMER = new javax.swing.JMenu();
        entMER = new javax.swing.JMenuItem();
        relMER = new javax.swing.JMenuItem();
        DicionaroMR = new javax.swing.JMenu();
        dicMR = new javax.swing.JMenuItem();
        Ajuda = new javax.swing.JMenu();
        Sobre = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(1288, 611));

        supPanel.setOpaque(false);

        javax.swing.GroupLayout supPanelLayout = new javax.swing.GroupLayout(supPanel);
        supPanel.setLayout(supPanelLayout);
        supPanelLayout.setHorizontalGroup(
            supPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 1053, Short.MAX_VALUE)
        );
        supPanelLayout.setVerticalGroup(
            supPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 687, Short.MAX_VALUE)
        );

        Arquivo.setText("Arquivo");

        Desconectar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W, java.awt.event.InputEvent.CTRL_MASK));
        Desconectar.setText("Desconectar");
        Desconectar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DesconectarActionPerformed(evt);
            }
        });
        Arquivo.add(Desconectar);

        jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem1.setText("Alterar Cadastro");
        Arquivo.add(jMenuItem1);

        Sair.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK));
        Sair.setText("Sair");
        Sair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SairActionPerformed(evt);
            }
        });
        Arquivo.add(Sair);

        MenuSuperior.add(Arquivo);

        Esquemas.setText("Esquemas");

        meusEsquemas.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_1, java.awt.event.InputEvent.CTRL_MASK));
        meusEsquemas.setText("Meus Esquemas");
        meusEsquemas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                meusEsquemasActionPerformed(evt);
            }
        });
        Esquemas.add(meusEsquemas);

        cadEsquemas.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_2, java.awt.event.InputEvent.CTRL_MASK));
        cadEsquemas.setText("Cadastrar Esquema");
        cadEsquemas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cadEsquemasActionPerformed(evt);
            }
        });
        Esquemas.add(cadEsquemas);

        altEsquemas.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_3, java.awt.event.InputEvent.CTRL_MASK));
        altEsquemas.setText("Alterar Esquema");
        altEsquemas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                altEsquemasActionPerformed(evt);
            }
        });
        Esquemas.add(altEsquemas);

        MenuSuperior.add(Esquemas);

        DicionarioMER.setText("Dicionário MER");

        entMER.setText("Entidades");
        entMER.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                entMERActionPerformed(evt);
            }
        });
        DicionarioMER.add(entMER);

        relMER.setText("Relacionamentos");
        relMER.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                relMERActionPerformed(evt);
            }
        });
        DicionarioMER.add(relMER);

        MenuSuperior.add(DicionarioMER);

        DicionaroMR.setText("DicionarioMR");

        dicMR.setText("Abrir Dicionário");
        dicMR.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                dicMRActionPerformed(evt);
            }
        });
        DicionaroMR.add(dicMR);

        MenuSuperior.add(DicionaroMR);

        Ajuda.setText("Ajuda");

        Sobre.setText("Sobre");
        Sobre.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SobreActionPerformed(evt);
            }
        });
        Ajuda.add(Sobre);

        MenuSuperior.add(Ajuda);

        setJMenuBar(MenuSuperior);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(supPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(supPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void SairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SairActionPerformed
        System.exit(0);
    }//GEN-LAST:event_SairActionPerformed

    private void DesconectarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DesconectarActionPerformed
        this.dispose();
        HomePort hp = new HomePort();
        hp.setVisible(true);
        hp.setBounds(0,0,1288,611);
    }//GEN-LAST:event_DesconectarActionPerformed

    private void SobreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SobreActionPerformed
        JOptionPane.showMessageDialog(null, "ThreeDs - Database Data Dictionary\n"                 + "Copyright 2011 - Universidade de Brasilia\n" + "Versao: 1.0", "Sobre", JOptionPane.PLAIN_MESSAGE);
    }//GEN-LAST:event_SobreActionPerformed

    private void meusEsquemasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_meusEsquemasActionPerformed
        MeusEsquemas me = new MeusEsquemas();
        this.add(me);
        me.setVisible(true);
        me.setBounds(10, 15, 600, 583);
    }//GEN-LAST:event_meusEsquemasActionPerformed

    private void cadEsquemasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cadEsquemasActionPerformed
        AddEsquema ce = new AddEsquema();
        this.add(ce);
        ce.setVisible(true);
        ce.setBounds(10, 15, 366, 533);
    }//GEN-LAST:event_cadEsquemasActionPerformed

    private void altEsquemasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_altEsquemasActionPerformed
        EditarEsquema ae = new EditarEsquema();
        this.add(ae);
        ae.setVisible(true);
        ae.setBounds(10, 15, 366, 533);
    }//GEN-LAST:event_altEsquemasActionPerformed

    private void entMERActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_entMERActionPerformed
        EntidadeMER emer = new EntidadeMER();
        this.add(emer);
        emer.setVisible(true);
        emer.setBounds(10, 15, 991, 616);
    }//GEN-LAST:event_entMERActionPerformed

    private void relMERActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_relMERActionPerformed
        RelacionamentoMER rmer = new RelacionamentoMER();
        this.add(rmer);
        rmer.setVisible(true);
        rmer.setBounds(10, 15, 569, 675);
    }//GEN-LAST:event_relMERActionPerformed

    private void dicMRActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dicMRActionPerformed
        DicMR dmr = new DicMR();
        this.add(dmr);
        dmr.setVisible(true);
        dmr.setBounds(10, 15, 922, 530);
    }//GEN-LAST:event_dicMRActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainPort.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainPort.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainPort.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainPort.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new MainPort().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu Ajuda;
    private javax.swing.JMenu Arquivo;
    private javax.swing.JMenuItem Desconectar;
    private javax.swing.JMenu DicionarioMER;
    private javax.swing.JMenu DicionaroMR;
    private javax.swing.JMenu Esquemas;
    private javax.swing.JMenuBar MenuSuperior;
    private javax.swing.JMenuItem Sair;
    private javax.swing.JMenuItem Sobre;
    private javax.swing.JMenuItem altEsquemas;
    private javax.swing.JMenuItem cadEsquemas;
    private javax.swing.JMenuItem dicMR;
    private javax.swing.JMenuItem entMER;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem meusEsquemas;
    private javax.swing.JMenuItem relMER;
    public javax.swing.JPanel supPanel;
    // End of variables declaration//GEN-END:variables
}
